<template>
  <div class="in-wrap">
    <!-- 公共头引入 -->
    <header id="header">
      <section class="container">
        <h1 id="logo">
          <a href="#" title="online学院">
            <img src="~/assets/img/logo2.png" width="100%" alt="online学院">
          </a>
        </h1>
        <div class="h-r-nsl">
          <ul class="nav">
            <router-link to="/" tag="li" active-class="current" exact>
              <a>首页</a>
            </router-link>
            <router-link to="/course" tag="li" active-class="current">
              <a>课程</a>
            </router-link>
            <router-link to="/teacher" tag="li" active-class="current">
              <a>名师</a>
            </router-link>
            <router-link to="/article" tag="li" active-class="current">
              <a>文章</a>
            </router-link>
            <router-link to="/qa" tag="li" active-class="current">
              <a>问答</a>
            </router-link>
            <router-link to="/me" tag="li" active-class="current">
              <a>关于作者</a>
            </router-link>
          </ul>
          <!-- / nav -->
          <ul class="h-r-login">
            <li v-if="!userInfo.id" id="no-login">
              <a href="/login" title="登录">
                <em class="icon18 login-icon">&nbsp;</em>
                <span class="vam ml5">登录</span>
              </a>
              |
              <a href="/login" title="注册">
                <span class="vam ml5">注册</span>
              </a>
            </li>
            <li v-if="userInfo.id" id="is-login-two" class="h-r-user">
              <a href="#" title>
                <img
                  :src="userInfo.avatar"
                  width="30"
                  height="30"
                  class="vam picImg"
                  alt
                >
                <span id="userName" class="vam disIb" style="max-width:100%">{{ userInfo.nickname }}</span>
              </a>
              <a href="/" title="退出" class="ml5">退出</a>
            </li>
            <!-- /未登录显示第1 li；登录后显示第2 li -->
          </ul>
          <aside class="h-r-search">
            <form action="#" method="post">
              <label class="h-r-s-box">
                <input type="text" placeholder="输入你想学的课程" name="queryCourse.courseName" value>
                <button type="submit" class="s-btn">
                  <em class="icon18">&nbsp;</em>
                </button>
              </label>
            </form>
          </aside>
        </div>
        <aside class="mw-nav-btn">
          <div class="mw-nav-icon"></div>
        </aside>
        <div class="clear"></div>
      </section>
    </header>
    <!-- /公共头引入 -->
    <nuxt/>
    <!-- 公共底引入 -->
    <footer id="footer">
      <section class="container">
        <div class>
          <h4 class="hLh30">
            <span class="fsize18 f-fM c-999">友情链接</span>
          </h4>
          <ul class="of flink-list">

            <li>
              <a>个人博客：</a>
              <a href="https://blog.csdn.net/qq_36609994" target="_blank">https://blog.csdn.net/qq_36609994</a>
            </li>
            <li>
              <a>Gitee：</a>
              <a href="https://gitee.com/JKcoding" target="_blank">https://gitee.com/JKcoding</a>
            </li>
          </ul>
          <div class="clear"></div>
        </div>
        <div class="b-foot">
          <section class="fl col-7">
            <section class="mr20">
              <section class="b-f-link">
                <a href="#" title="关于我们" target="_blank">关于我们</a>|
                <a href="#" title="联系我们" target="_blank">联系我们</a>|
                <a href="#" title="帮助中心" target="_blank">帮助中心</a>|
                <a href="#" title="资源下载" target="_blank">资源下载</a><br/>
                <span>QQ：1327639463</span>
                <span>QQ群：665943342</span>
                <span>Email：1327639463@qq.com</span>
              </section>
              <section class="b-f-link mt10">
                <span>©以上课程涉及版权问题的可以联系online学院进行删除</span>
              </section>
            </section>
          </section>
          <aside class="fl col-3 tac mt15">
            <section class="gf-tx">
              <span>
                <img src="~/assets/img/wx-icon.png" alt>
              </span>
            </section>
            <section class="gf-tx">
              <span>
                <img src="~/assets/img/wb-icon.png" alt>
              </span>
            </section>
          </aside>
          <div class="clear"></div>
        </div>
      </section>
    </footer>
    <!-- /公共底引入 -->
  </div>
</template>

<script>
    import "~/assets/css/reset.css";
    import "~/assets/css/theme.css";
    import "~/assets/css/global.css";
    import "~/assets/css/web.css";
    import member from "@/api/member";
    export default {
        data() {
            return {
                token: '',
                userInfo: {}
            }
        },
        created() {
            this.token = this.$route.query.token
            if (this.token) {
                this.showInfo()
            }
        },
        methods: {
            showInfo() {
                member.getUserInfo(this.token)
                    .then(response => {
                        console.log(response.data.data.member)
                        this.userInfo = response.data.data.member
                    })
            }
        }
    };
</script>

